{{useCss "/app-pages/css/user/buff.scss"}}
<div class="points">
    <div class="nav">
        <href to="/user/buff.html">
            <div class="nav-li">积分规则</div>
        </href>
        <href to="/user/shoppinguide.html">
            <div class="nav-li">员工提成</div>
        </href>
        <div class="nav-li focus">分销提成</div>
    </div>
    <hr/>
    <div class="box">
        <table class="info">
            <thead>
                <td style="width: 8%;"></td>
                <td style="width: 17%;">商家名</td>
                <td>一级返利</td>
                <td style="width: 10%;">二级返利</td>
                <td style="width: 10%;">三级返利</td>
                <td>已兑现额度</td>
                <td>可兑现额度</td>
                <td>操作</td>
            </thead>
            {{#each $Cache.user.bina.all}}
            <tr>
                <td>
                    <a target="_blank" href="{{bus.url}}">
                        <div class="logo">
                            <img bind-src="{{bus.info.logo_url&&(bus.info.logo_url+'?imageView/1/w/50/h/50')||'/images/logo.jpg'}}" />
                        </div>
                    </a>
                </td>
                <td>
                    <a target="_blank" href="{{bus.url}}">
                        <div class="storename">{{bus.info.title}}</div>
                    </a>
                </td>
                <td style="text-align:center;">￥{{#Fixed total_first_acc}} {{#if _show_first_acc_users}}
                    <button event-click="{{'$Top.$Event.user.bina.close_first_acc_users'}}" class="icon-eye-blocked" title="关闭"></button>
                    {{#else}}
                    <button event-click="{{'$Top.$Event.user.bina.open_first_acc_users'}}" class="icon-eye" title="查看金额分布详情"></button>
                    {{/if}}
                </td>
                <td style="text-align:center;">￥{{#Fixed total_second_acc}}</td>
                <td style="text-align:center;">￥{{#Fixed total_third_acc}}</td>
                <td style="text-align:center;">￥{{#Fixed exchange_acc.exchanged_acc}}</td>
                <td style="text-align:center;">￥{{#Fixed can_apply_acc}}</td>
                <td>
                    {{#if exchange_acc.state === $Top.config.BINA_STATE.未申请兑换}}
                    <button disabled="{{can_apply_acc==0}}" event-click="{{'$Top.$Event.user.bina.未申请兑换_to_申请兑换中'}}">申请提现</button>
                    {{/if}} {{#if exchange_acc.state === $Top.config.BINA_STATE.申请兑换中}}
                    <i>等待商家打款</i>
                    {{/if}} {{#if exchange_acc.state === $Top.config.BINA_STATE.商家已付款}}
                    <button event-click="{{'$Top.$Event.user.bina.商家已付款_to_用户确认付款'}}">确定收款</button>
                    {{/if}}
                </td>
            </tr>
            {{#> "user_bina-acc_users","$This",_show_first_acc_users}} {{/each}}
        </table>

    </div>
</div>
<xmp type="template" name="user_bina-acc_users">
    <tr>
        <td colspan="10">
            <center style="padding: 0 2em 0.5em 2em;">
                <table class="paper-table">
                    <thead>
                        <td>用户名</td>
                        <td>邮箱</td>
                        <td>消费金额</td>
                    </thead>
                    {{#each first_acc_users}}
                    <tr>
                        <td style="text-align:center;">{{user.info.name}}</td>
                        <td style="text-align:center;">{{user.info.email}}</td>
                        <td style="text-align:center;">￥{{#Fixed total_first_cash}}</td>
                    </tr>
                    {{/each}}
                </table>
            </center>
        </td>
    </tr>
</xmp>
